import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_ahj_app/app/yhpc/YhpcViewModel.dart';
import 'package:flutter_ahj_app/app/yhpc/yhzl/CustomSelectSbView.dart';
import 'package:flutter_ahj_app/base/basewidget/view/BaseWidget.dart';
import 'package:flutter_ahj_app/base/utils/EmptyUtils.dart';
import 'package:flutter_ahj_app/base/utils/JUIKit/JText.dart';
import 'package:flutter_ahj_app/base/utils/ShowFiles/GetImageWidget.dart';
import 'package:flutter_ahj_app/base/utils/StringUtils.dart';
import 'package:flutter_ahj_app/base/utils/ToastUtils.dart';
import 'package:flutter_ahj_app/base/utils/mTopBar.dart';
import 'package:flutter_ahj_app/base/utils/video_player_page.dart';
import 'package:flutter_ahj_app/base/values/SQColor.dart';
import 'package:flutter_ahj_app/base/values/dimens.dart';
import 'package:flutter_ahj_app/base/widget/NoneData.dart';

class YhzlyhDetailView extends BaseStatefulWidget {
  final Map zlMap;

  YhzlyhDetailView({this.zlMap});

  @override
  State<StatefulWidget> initState() {
    // TODO: implement initState
    // throw UnimplementedError();
    return YhzlyhDetailViewState();
  }
}

class YhzlyhDetailViewState extends BaseState<YhpcViewModel, YhzlyhDetailView> {
  BuildContext _mcontext;

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    print(widget.zlMap);
    Future.delayed(Duration.zero, () {
      _getData();
    });
  }

  @override
  Widget initWidget() {
    return Scaffold(
      backgroundColor: Color(0xfff4f5f6),
      appBar: MTopBar(
        elevation: 0,
        title: '隐患详情',
      ).create(),
      body: EmptyUtils.isForEmpty(_registerInfo) &&
              EmptyUtils.isForEmpty(_determineInfo) &&
              EmptyUtils.isForEmpty(_verifyInfo) &&
              EmptyUtils.isForEmpty(_rectifyInfo) &&
              EmptyUtils.isForEmpty(_acceptanceInfo)
          ? NoneData()
          : _bodyView(),
    );
  }

  _bodyView() {
    _mcontext = context;
    return Container(
      child: Column(
        children: [
          Expanded(
              child: SingleChildScrollView(
            child: Container(
              child: Column(
                children: [
                  EmptyUtils.isForEmpty(_registerInfo)
                      ? Container(
                          margin: EdgeInsets.only(top: 15),
                        )
                      : Container(
                          margin: EdgeInsets.only(top: 15),
                          padding: EdgeInsets.fromLTRB(
                              Dimens.dimens10, 0, Dimens.dimens10, 0),
                          child: Card(
                            elevation: 0,
                            child: Container(
                              child: Column(
                                crossAxisAlignment: CrossAxisAlignment.start,
                                children: [
                                  Container(
                                    margin: EdgeInsets.all(15),
                                    child: Column(
                                      crossAxisAlignment:
                                          CrossAxisAlignment.start,
                                      children: [
                                        JText(
                                          "隐患登记信息",
                                          fontWeight: FontWeight.bold,
                                        ),
                                        Container(
                                          height: 1,
                                          width: double.infinity,
                                          color: SQColor.black_cecece,
                                          margin: EdgeInsets.only(
                                              top: Dimens.dimens16),
                                        ),
                                        SizedBox(
                                          height: 16,
                                        ),
                                        Column(
                                          crossAxisAlignment:
                                              CrossAxisAlignment.start,
                                          children: [
                                            _registerInfo['hazardRectifyBeforeFileList'] ==
                                                        null ||
                                                    _registerInfo[
                                                                'hazardRectifyBeforeFileList']
                                                            .length ==
                                                        0
                                                ? Container()
                                                : _imaeWidget(
                                                    _registerInfo[
                                                        'hazardRectifyBeforeFileList'],
                                                    "整改前隐患视图："),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "隐患名称：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _registerInfo[
                                                              'hazardName']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "排查对象：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _registerInfo[
                                                              'riskPointName']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "排查项：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _registerInfo[
                                                              'dangerSourceName']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "排查内容：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _registerInfo[
                                                              'controlMeasure']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "隐患描述：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _registerInfo[
                                                              'description']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "隐患来源：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _registerInfo[
                                                              'hazardSourceName']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "隐患责任部门：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _registerInfo[
                                                              'riskPointOrgCodeName']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "隐患类别：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _registerInfo[
                                                              'hazardCategoryName']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "隐患等级：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _registerInfo[
                                                              'hazardRegisterLevelName']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "隐患所在场所/位置：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _registerInfo[
                                                              'riskPointDistrictName']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            _registerInfo[
                                                        'hazardRegisterMethod'] ==
                                                    'rectifyRegister'
                                                ? Container()
                                                : Row(
                                                    crossAxisAlignment:
                                                        CrossAxisAlignment
                                                            .start,
                                                    children: [
                                                      JText(
                                                        StringUtils.getStr(
                                                                    _registerInfo[
                                                                        'hazardRegisterMethod']) ==
                                                                'snapshot'
                                                            ? "隐患判定人:"
                                                            : "隐患核查人：",
                                                        color: SQColor
                                                            .black_999999,
                                                      ),
                                                      Expanded(
                                                        child: Container(
                                                          padding:
                                                              EdgeInsets.only(
                                                                  left: Dimens
                                                                      .dimens20),
                                                          child: JText(
                                                            StringUtils.getStr(
                                                                        _registerInfo[
                                                                            'hazardRegisterMethod']) ==
                                                                    'snapshot'
                                                                ? StringUtils.getStr(
                                                                    _registerInfo[
                                                                        'deciderName'])
                                                                : StringUtils.getStr(
                                                                    _registerInfo[
                                                                        'verifierName']),
                                                            textAlign:
                                                                TextAlign.right,
                                                            color: SQColor
                                                                .black_999999,
                                                            fontSize: 14,
                                                          ),
                                                        ),
                                                      ),
                                                    ],
                                                  ),
                                            _registerInfo[
                                                        'hazardRegisterMethod'] ==
                                                    'rectifyRegister'
                                                ? Container()
                                                : SizedBox(
                                                    height: 10,
                                                  ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "登记人：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _registerInfo[
                                                              'createUserName']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "登记时间：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _registerInfo[
                                                              'submitTime']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "创建时间：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _registerInfo[
                                                              'createTime']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                          ],
                                        ),
                                      ],
                                    ),
                                  ),
                                ],
                              ),
                            ),
                          ),
                        ),
                  EmptyUtils.isForEmpty(_determineInfo)
                      ? Container(
                          margin: EdgeInsets.only(top: 15),
                        )
                      : Container(
                          padding: EdgeInsets.fromLTRB(Dimens.dimens10, 0,
                              Dimens.dimens10, Dimens.dimens10),
                          child: Card(
                            elevation: 0,
                            child: Container(
                              child: Column(
                                crossAxisAlignment: CrossAxisAlignment.start,
                                children: [
                                  Container(
                                    margin: EdgeInsets.all(15),
                                    child: Column(
                                      crossAxisAlignment:
                                          CrossAxisAlignment.start,
                                      children: [
                                        JText(
                                          "隐患判定信息",
                                          fontWeight: FontWeight.bold,
                                        ),
                                        Container(
                                          height: 1,
                                          width: double.infinity,
                                          color: SQColor.black_cecece,
                                          margin: EdgeInsets.only(
                                              top: Dimens.dimens16),
                                        ),
                                        SizedBox(
                                          height: 16,
                                        ),
                                        Column(
                                          crossAxisAlignment:
                                              CrossAxisAlignment.start,
                                          children: [
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "判定结果：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _determineInfo[
                                                              'determineResultTypeName']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "判定结果说明：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _determineInfo[
                                                              'determineResultDescription']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            _registerInfo[
                                                        'hazardRegisterMethod'] ==
                                                    'snapshot'
                                                ? Row(
                                                    crossAxisAlignment:
                                                        CrossAxisAlignment
                                                            .start,
                                                    children: [
                                                      JText(
                                                        "判定人：",
                                                        color: SQColor
                                                            .black_999999,
                                                      ),
                                                      Expanded(
                                                        child: Container(
                                                          padding:
                                                              EdgeInsets.only(
                                                                  left: Dimens
                                                                      .dimens20),
                                                          child: JText(
                                                            StringUtils.getStr(
                                                                _determineInfo[
                                                                    'deciderName']),
                                                            textAlign:
                                                                TextAlign.right,
                                                            color: SQColor
                                                                .black_999999,
                                                            fontSize: 14,
                                                          ),
                                                        ),
                                                      ),
                                                    ],
                                                  )
                                                : Container(),
                                            _registerInfo[
                                                        'hazardRegisterMethod'] ==
                                                    'snapshot'
                                                ? SizedBox(
                                                    height: 10,
                                                  )
                                                : Container(),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "判定时间：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _determineInfo[
                                                              'determineTime']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "排查对象：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _determineInfo[
                                                              'riskPointName']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "排查项：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _determineInfo[
                                                              'dangerSourceName']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "排查内容：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _determineInfo[
                                                              'controlMeasure']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "隐患地点：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _determineInfo[
                                                              'riskPointDistrictName']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "隐患责任部门：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _determineInfo[
                                                              'riskPointOrgCodeName']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "隐患类别：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _determineInfo[
                                                              'hazardCategoryName']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            // Row(
                                            //   crossAxisAlignment:
                                            //       CrossAxisAlignment.start,
                                            //   children: [
                                            //     JText(
                                            //       "隐患等级：",
                                            //       color: SQColor.black_999999,
                                            //     ),
                                            //     Expanded(
                                            //       child: Container(
                                            //         padding: EdgeInsets.only(
                                            //             left: Dimens.dimens20),
                                            //         child: JText(
                                            //           StringUtils.getStr(
                                            //               _determineInfo[
                                            //                   'hazardRegisterLevelName']),
                                            //           textAlign:
                                            //               TextAlign.right,
                                            //           color:
                                            //               SQColor.black_999999,
                                            //           fontSize: 14,
                                            //         ),
                                            //       ),
                                            //     ),
                                            //   ],
                                            // ),
                                          ],
                                        ),
                                      ],
                                    ),
                                  ),
                                ],
                              ),
                            ),
                          ),
                        ),
                  EmptyUtils.isForEmpty(_verifyInfo)
                      ? Container(
                          margin: EdgeInsets.only(top: 15),
                        )
                      : Container(
                          padding: EdgeInsets.fromLTRB(Dimens.dimens10, 0,
                              Dimens.dimens10, Dimens.dimens10),
                          child: Card(
                            elevation: 0,
                            child: Container(
                              child: Column(
                                crossAxisAlignment: CrossAxisAlignment.start,
                                children: [
                                  Container(
                                    margin: EdgeInsets.all(15),
                                    child: Column(
                                      crossAxisAlignment:
                                          CrossAxisAlignment.start,
                                      children: [
                                        JText(
                                          "隐患核查信息",
                                          fontWeight: FontWeight.bold,
                                        ),
                                        Container(
                                          height: 1,
                                          width: double.infinity,
                                          color: SQColor.black_cecece,
                                          margin: EdgeInsets.only(
                                              top: Dimens.dimens16),
                                        ),
                                        SizedBox(
                                          height: 16,
                                        ),
                                        Column(
                                          crossAxisAlignment:
                                              CrossAxisAlignment.start,
                                          children: [
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "隐患核查结果：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _verifyInfo[
                                                              'verifyResultTypeName']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            _verifyInfo['verifyResultType'] ==
                                                    'majorHazard'
                                                ? Row(
                                                    crossAxisAlignment:
                                                        CrossAxisAlignment
                                                            .start,
                                                    children: [
                                                      JText(
                                                        "隐患治理目标：",
                                                        color: SQColor
                                                            .black_999999,
                                                      ),
                                                      Expanded(
                                                        child: Container(
                                                          padding:
                                                              EdgeInsets.only(
                                                                  left: Dimens
                                                                      .dimens20),
                                                          child: JText(
                                                            StringUtils.getStr(
                                                                _verifyInfo[
                                                                    'hazardGovernTarget']),
                                                            textAlign:
                                                                TextAlign.right,
                                                            color: SQColor
                                                                .black_999999,
                                                            fontSize: 14,
                                                          ),
                                                        ),
                                                      ),
                                                    ],
                                                  )
                                                : Container(),
                                            _verifyInfo['verifyResultType'] ==
                                                    'majorHazard'
                                                ? SizedBox(
                                                    height: 10,
                                                  )
                                                : Container(),
                                            _verifyInfo['verifyResultType'] ==
                                                    'majorHazard'
                                                ? Row(
                                                    crossAxisAlignment:
                                                        CrossAxisAlignment
                                                            .start,
                                                    children: [
                                                      JText(
                                                        "隐患治理任务：",
                                                        color: SQColor
                                                            .black_999999,
                                                      ),
                                                      Expanded(
                                                        child: Container(
                                                          padding:
                                                              EdgeInsets.only(
                                                                  left: Dimens
                                                                      .dimens20),
                                                          child: JText(
                                                            StringUtils.getStr(
                                                                _verifyInfo[
                                                                    'hazardGovernTask']),
                                                            textAlign:
                                                                TextAlign.right,
                                                            color: SQColor
                                                                .black_999999,
                                                            fontSize: 14,
                                                          ),
                                                        ),
                                                      ),
                                                    ],
                                                  )
                                                : Container(),
                                            _verifyInfo['verifyResultType'] ==
                                                    'majorHazard'
                                                ? SizedBox(
                                                    height: 10,
                                                  )
                                                : Container(),
                                            _verifyInfo['verifyResultType'] ==
                                                    'majorHazard'
                                                ? Row(
                                                    crossAxisAlignment:
                                                        CrossAxisAlignment
                                                            .start,
                                                    children: [
                                                      JText(
                                                        "隐患治理采取方法：",
                                                        color: SQColor
                                                            .black_999999,
                                                      ),
                                                      Expanded(
                                                        child: Container(
                                                          padding:
                                                              EdgeInsets.only(
                                                                  left: Dimens
                                                                      .dimens20),
                                                          child: JText(
                                                            StringUtils.getStr(
                                                                _verifyInfo[
                                                                    'hazardGovernMethod']),
                                                            textAlign:
                                                                TextAlign.right,
                                                            color: SQColor
                                                                .black_999999,
                                                            fontSize: 14,
                                                          ),
                                                        ),
                                                      ),
                                                    ],
                                                  )
                                                : Container(),
                                            _verifyInfo['verifyResultType'] ==
                                                    'majorHazard'
                                                ? SizedBox(
                                                    height: 10,
                                                  )
                                                : Container(),
                                            _verifyInfo['verifyResultType'] ==
                                                    'majorHazard'
                                                ? Row(
                                                    crossAxisAlignment:
                                                        CrossAxisAlignment
                                                            .start,
                                                    children: [
                                                      JText(
                                                        "隐患治理经费和物资：",
                                                        color: SQColor
                                                            .black_999999,
                                                      ),
                                                      Expanded(
                                                        child: Container(
                                                          padding:
                                                              EdgeInsets.only(
                                                                  left: Dimens
                                                                      .dimens20),
                                                          child: JText(
                                                            StringUtils.getStr(
                                                                _verifyInfo[
                                                                    'hazardGovernMaterial']),
                                                            textAlign:
                                                                TextAlign.right,
                                                            color: SQColor
                                                                .black_999999,
                                                            fontSize: 14,
                                                          ),
                                                        ),
                                                      ),
                                                    ],
                                                  )
                                                : Container(),
                                            _verifyInfo['verifyResultType'] ==
                                                    'majorHazard'
                                                ? SizedBox(
                                                    height: 10,
                                                  )
                                                : Container(),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "隐患核查意见：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _verifyInfo[
                                                              'verifyOpinionDescription']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "隐患归属专业：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _verifyInfo[
                                                              'hazardProfessionName']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "简要原因分析：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _verifyInfo[
                                                              'reasonAnalyzeDescription']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "隐患治理措施：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _verifyInfo[
                                                              'hazardGovernMeasure']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "隐患整改责任人：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _verifyInfo[
                                                              'rectifyResponsiblePersonName']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "隐患整改责任部门：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _verifyInfo[
                                                              'rectifyResponsibleOrgCodeName']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "整改类型：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _verifyInfo[
                                                              'rectifyTypeName']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "整改期限：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _verifyInfo[
                                                              'rectifyCompleteDeadlineTime']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                          ],
                                        ),
                                      ],
                                    ),
                                  ),
                                ],
                              ),
                            ),
                          ),
                        ),
                  EmptyUtils.isForEmpty(_rectifyInfo)
                      ? Container(
                          margin: EdgeInsets.only(top: 15),
                        )
                      : Container(
                          padding: EdgeInsets.fromLTRB(Dimens.dimens10, 0,
                              Dimens.dimens10, Dimens.dimens10),
                          child: Card(
                            elevation: 0,
                            child: Container(
                              child: Column(
                                crossAxisAlignment: CrossAxisAlignment.start,
                                children: [
                                  Container(
                                    margin: EdgeInsets.all(15),
                                    child: Column(
                                      crossAxisAlignment:
                                          CrossAxisAlignment.start,
                                      children: [
                                        JText(
                                          "隐患整改信息",
                                          fontWeight: FontWeight.bold,
                                        ),
                                        Container(
                                          height: 1,
                                          width: double.infinity,
                                          color: SQColor.black_cecece,
                                          margin: EdgeInsets.only(
                                              top: Dimens.dimens16),
                                        ),
                                        SizedBox(
                                          height: 16,
                                        ),
                                        Column(
                                          crossAxisAlignment:
                                              CrossAxisAlignment.start,
                                          children: [
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "隐患整改措施：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _rectifyInfo[
                                                              'rectifyMeasure']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "隐患整改资金（元）：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                              _rectifyInfo[
                                                                      'rectifyMoney']
                                                                  .toString()) +
                                                          '元',
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "隐患整改负责人：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _rectifyInfo[
                                                              'rectifyResponsiblePersonName']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "隐患整改责任部门：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _rectifyInfo[
                                                              'rectifyResponsibleOrgCodeName']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "整改完成时间：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _rectifyInfo[
                                                              'rectifyCompleteTime']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            _rectifyInfo['hazardRectifyAfterFileList'] ==
                                                        null ||
                                                    _rectifyInfo[
                                                                'hazardRectifyAfterFileList']
                                                            .length ==
                                                        0
                                                ? Container()
                                                : _imaeWidget(
                                                    _rectifyInfo[
                                                        'hazardRectifyAfterFileList'],
                                                    "整改后的隐患视图："),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "隐患整改情况：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _rectifyInfo[
                                                              'rectifyDescription']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                          ],
                                        ),
                                      ],
                                    ),
                                  ),
                                ],
                              ),
                            ),
                          ),
                        ),
                  EmptyUtils.isForEmpty(_acceptanceInfo)
                      ? Container(
                          margin: EdgeInsets.only(top: 15),
                        )
                      : Container(
                          padding: EdgeInsets.fromLTRB(Dimens.dimens10, 0,
                              Dimens.dimens10, Dimens.dimens10),
                          child: Card(
                            elevation: 0,
                            child: Container(
                              child: Column(
                                crossAxisAlignment: CrossAxisAlignment.start,
                                children: [
                                  Container(
                                    margin: EdgeInsets.all(15),
                                    child: Column(
                                      crossAxisAlignment:
                                          CrossAxisAlignment.start,
                                      children: [
                                        JText(
                                          "隐患验收信息",
                                          fontWeight: FontWeight.bold,
                                        ),
                                        Container(
                                          height: 1,
                                          width: double.infinity,
                                          color: SQColor.black_cecece,
                                          margin: EdgeInsets.only(
                                              top: Dimens.dimens16),
                                        ),
                                        SizedBox(
                                          height: 16,
                                        ),
                                        Column(
                                          crossAxisAlignment:
                                              CrossAxisAlignment.start,
                                          children: [
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "隐患验收人：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _acceptanceInfo[
                                                              'acceptorName']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "验收结果：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _acceptanceInfo[
                                                              'acceptanceResultTypeName']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            Row(
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.start,
                                              children: [
                                                JText(
                                                  "验收情况说明：",
                                                  color: SQColor.black_999999,
                                                ),
                                                Expanded(
                                                  child: Container(
                                                    padding: EdgeInsets.only(
                                                        left: Dimens.dimens20),
                                                    child: JText(
                                                      StringUtils.getStr(
                                                          _acceptanceInfo[
                                                              'acceptanceDescription']),
                                                      textAlign:
                                                          TextAlign.right,
                                                      color:
                                                          SQColor.black_999999,
                                                      fontSize: 14,
                                                    ),
                                                  ),
                                                ),
                                              ],
                                            ),
                                            SizedBox(
                                              height: 10,
                                            ),
                                            _acceptanceInfo['acceptanceFileList'] ==
                                                        null ||
                                                    _acceptanceInfo[
                                                                'acceptanceFileList']
                                                            .length ==
                                                        0
                                                ? Container()
                                                : _imaeWidget(
                                                    _acceptanceInfo[
                                                        'acceptanceFileList'],
                                                    "验收附件："),
                                          ],
                                        ),
                                      ],
                                    ),
                                  ),
                                ],
                              ),
                            ),
                          ),
                        ),
                ],
              ),
            ),
          )),
          StringUtils.getStr(widget.zlMap['zlType']) == 'hc'
              ? _bottomViewhc()
              : Container(),
          StringUtils.getStr(widget.zlMap['zlType']) == 'zg'
              ? _bottomViewzg()
              : Container(),
          StringUtils.getStr(widget.zlMap['zlType']) == 'ys'
              ? _bottomViewys()
              : Container(),
          StringUtils.getStr(widget.zlMap['zlType']) == 'pd'
              ? _bottomViewpd()
              : Container(),
        ],
      ),
    );
  }

  _imaeWidget(var list, var title) {
    List filePath = [];
    for (var i = 0; i < list.length; i++) {
      filePath.add(list[i]['url']);
    }
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        JText(
          title,
          color: SQColor.black_999999,
        ),
        Container(
          height: 10,
        ),
        GridView.builder(
            padding: EdgeInsets.zero,
            physics: const NeverScrollableScrollPhysics(),
            shrinkWrap: true,
            gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
                crossAxisCount: 4, //每行三列
                childAspectRatio: 1 //显示区域宽高相等
                ),
            itemCount: list.length,
            itemBuilder: (context, index) {
              return GestureDetector(
                  onTap: () {
                    if (filePath[index].contains("mp4")) {
                      Navigator.push(
                          context,
                          MaterialPageRoute(
                              builder: (context) => VideoPlayerPage(
                                    videoPath: filePath[index],
                                    videoSource: "1",
                                  )));
                    } else {
                      List<String> filePath1 = [];
                      int position = 0;
                      for (int i = 0; i < filePath.length; i++) {
                        if (!filePath[i].contains(".mp4")) {
                          filePath1.add(filePath[i]);
                        }
                      }
                      for (int i = 0; i < filePath1.length; i++) {
                        if (filePath1[i] == filePath[index]) {
                          position = i;
                        }
                      }
                      Navigator.pushNamed(context, "/ShowImage", arguments: {
                        'position': position,
                        'filePath': filePath1
                      });
                    }
                  },
                  child: Column(
                    children: [
                      Expanded(
                        child: ImageWidget(
                          fileName: list[index]['url'],
                        ),
                      ),
                      Container(
                        height: 10,
                      ),
                    ],
                  ));
            }),
        Container(
          height: 10,
        ),
      ],
    );
  }

  _bottomViewhc() {
    return Container(
      margin: EdgeInsets.only(top: Dimens.dimens12),
      child: Row(
        children: [
          Expanded(
            child: InkWell(
              onTap: () {
                _yhzlitemClick('上报');
              },
              child: SafeArea(
                child: Container(
                  margin: EdgeInsets.only(left: 15, right: 15),
                  height: 45,
                  alignment: Alignment.center,
                  decoration: BoxDecoration(
                      color: SQColor.white,
                      border: Border.all(
                        width: 1,
                        color: SQColor.theme_color,
                      ),
                      borderRadius: BorderRadius.circular(8)),
                  child: JText('上报', color: SQColor.theme_color),
                ),
              ),
            ),
          ),
          Expanded(
            child: InkWell(
              onTap: () {
                _yhzlitemClick('核查');
              },
              child: SafeArea(
                child: Container(
                  margin: EdgeInsets.only(left: 15, right: 15),
                  height: 45,
                  alignment: Alignment.center,
                  decoration: BoxDecoration(
                    color: SQColor.theme_color,
                    borderRadius: BorderRadius.circular(10),
                  ),
                  child: JText('核查', color: Colors.white),
                ),
              ),
            ),
          ),
        ],
      ),
    );
  }

  _bottomViewpd() {
    return Container(
      margin: EdgeInsets.only(top: Dimens.dimens12),
      child: Row(
        children: [
          Expanded(
            child: InkWell(
              onTap: () {
                _yhzlitemClick('判定');
              },
              child: SafeArea(
                child: Container(
                  margin: EdgeInsets.only(left: 15, right: 15),
                  height: 45,
                  alignment: Alignment.center,
                  decoration: BoxDecoration(
                    color: SQColor.theme_color,
                    borderRadius: BorderRadius.circular(10),
                  ),
                  child: JText('判定', color: Colors.white),
                ),
              ),
            ),
          ),
        ],
      ),
    );
  }

  _bottomViewys() {
    return Container(
      margin: EdgeInsets.only(top: Dimens.dimens12),
      child: Row(
        children: [
          Expanded(
            child: InkWell(
              onTap: () {
                _yhzlitemClick('验收');
              },
              child: SafeArea(
                child: Container(
                  margin: EdgeInsets.only(left: 15, right: 15),
                  height: 45,
                  alignment: Alignment.center,
                  decoration: BoxDecoration(
                    color: SQColor.theme_color,
                    borderRadius: BorderRadius.circular(10),
                  ),
                  child: JText('验收', color: Colors.white),
                ),
              ),
            ),
          ),
        ],
      ),
    );
  }

  _bottomViewzg() {
    return Container(
      margin: EdgeInsets.only(top: Dimens.dimens12),
      child: Row(
        children: [
          Expanded(
            child: InkWell(
              onTap: () {
                _yhzlitemClick('退回');
              },
              child: SafeArea(
                child: Container(
                  margin: EdgeInsets.only(left: 15, right: 15),
                  height: 45,
                  alignment: Alignment.center,
                  decoration: BoxDecoration(
                      color: SQColor.white,
                      border: Border.all(
                        width: 1,
                        color: SQColor.theme_color,
                      ),
                      borderRadius: BorderRadius.circular(8)),
                  child: JText('退回', color: SQColor.theme_color),
                ),
              ),
            ),
          ),
          Expanded(
            child: InkWell(
              onTap: () {
                _yhzlitemClick('整改');
              },
              child: SafeArea(
                child: Container(
                  margin: EdgeInsets.only(left: 15, right: 15),
                  height: 45,
                  alignment: Alignment.center,
                  decoration: BoxDecoration(
                    color: SQColor.theme_color,
                    borderRadius: BorderRadius.circular(10),
                  ),
                  child: JText('整改', color: Colors.white),
                ),
              ),
            ),
          ),
        ],
      ),
    );
  }

  _yhzlitemClick(String title) {
    switch (title) {
      case '判定':
        Navigator.pushNamed(context, '/YhzlpdView',
            arguments: StringUtils.getStr(widget.zlMap['id'].toString()));
        break;
      case '核查':
        Navigator.pushNamed(context, '/YhzlhcView',
            arguments: StringUtils.getStr(widget.zlMap['id'].toString()));
        break;
      case '上报':
        _yhzlsb();
        break;
      case '退回':
        _yhzlth();
        break;
      case '验收':
        Navigator.pushNamed(context, '/YhzlysView',
            arguments: StringUtils.getStr(widget.zlMap['id'].toString()));
        break;
      case '整改':
        var _m = EmptyUtils.isForEmpty(_rectifyInfo)
            ? {'id': StringUtils.getStr(widget.zlMap['id'].toString())}
            : _rectifyInfo;
        if (!EmptyUtils.isForEmpty(_rectifyInfo)) {
          _m.addAll({'id': StringUtils.getStr(widget.zlMap['id'].toString())});
        }
        Navigator.pushNamed(context, '/YhzlzgView', arguments: _m);
        break;
      default:
    }
  }

  TextEditingController _thCtr = new TextEditingController(text: '');
  _yhzlth() {
    showCupertinoDialog(
        context: context,
        builder: (context) {
          return CupertinoAlertDialog(
            title: new Row(
              children: <Widget>[
                Expanded(
                  child: Text('退回原因 '),
                  flex: 1,
                ),
                new GestureDetector(
                  child: new Icon(Icons.close),
                  onTap: () {
                    _thCtr.text = "";
                    Navigator.pop(context);
                  },
                )
              ],
            ),
            content: Card(
              elevation: 0.0,
              child: Column(
                children: <Widget>[
                  TextField(
                    controller: _thCtr,
                    maxLines: 3,
                    minLines: 3,
                    maxLength: 200,
                    decoration: InputDecoration(
                      hintText: '请输入退回原因(最多200个字)',
                      fillColor: SQColor.lightGray1,
                      border: InputBorder.none,
                      filled: true,
                    ),
                  )
                ],
              ),
            ),
            actions: <Widget>[
              CupertinoDialogAction(
                onPressed: () {
                  if (StringUtils.getStr(_thCtr.text) == "") {
                    ToastUtils.showToast("请先输入退回原因");
                    return;
                  }
                  _submitth();
                  Navigator.pop(context);
                },
                child: Text('确定'),
              ),
            ],
          );
        });
  }

  _submitth() {
    var map = {
      'hazardId': StringUtils.getStr(widget.zlMap['id'].toString()),
      'rectifyRejectReason': _thCtr.text,
    };
    viewModel.yhth(map);
    viewModel.yhthDataStream().listen((event) {
      if (event['code'] == '0') {
        _thCtr.text = "";
        ToastUtils.showToast('退回成功');
        Navigator.pop(context);
      } else {
        ToastUtils.showToast(event['msg']);
      }
    }, onError: (e) {
      print(e);
    });
  }

  TextEditingController _shangbaocontent = new TextEditingController(text: '');
  String _wgName = "", _wgNameid = "";
  _yhzlsb() {
    showCupertinoDialog(
        context: context,
        builder: (context) {
          return CupertinoAlertDialog(
            title: new Row(
              children: <Widget>[
                Expanded(
                  child: Text('上报原因 '),
                  flex: 1,
                ),
                new GestureDetector(
                  child: new Icon(Icons.close),
                  onTap: () {
                    _shangbaocontent.text = "";
                    _wgNameid = "";
                    _wgName = "";
                    Navigator.pop(context);
                  },
                )
              ],
            ),
            content: Card(
              elevation: 0.0,
              child: Column(
                children: <Widget>[
                  TextField(
                    controller: _shangbaocontent,
                    maxLines: 3,
                    minLines: 3,
                    maxLength: 200,
                    decoration: InputDecoration(
                      hintText: '请输入上报原因(最多200个字)',
                      fillColor: SQColor.lightGray1,
                      border: InputBorder.none,
                      filled: true,
                    ),
                  ),
                  new CustomSelectSbView(
                    callBack: (id, name) {
                      _wgName = name;
                      _wgNameid = id;
                      print('-----------');
                      if (!StringUtils.isEmpty(_wgNameid)) {
                        _yhzlsb();
                      }
                    },
                    mcontext: _mcontext,
                    wgName: _wgName,
                    wgNameid: _wgNameid,
                  )
                ],
              ),
            ),
            actions: <Widget>[
              CupertinoDialogAction(
                onPressed: () {
                  if (StringUtils.getStr(_wgNameid) == "") {
                    ToastUtils.showToast("请先选择确认人");
                    return;
                  }
                  if (StringUtils.getStr(_shangbaocontent.text) == "") {
                    ToastUtils.showToast("请先输入上报原因");
                    return;
                  }
                  _submit();
                  Navigator.pop(context);
                },
                child: Text('确定'),
              ),
            ],
          );
        });
  }

  _submit() {
    var map = {
      'hazardId': StringUtils.getStr(widget.zlMap['id'].toString()),
      'reportReason': _shangbaocontent.text,
      'reportConfirmOpenId': StringUtils.getStr(_wgNameid),
    };
    viewModel.yhsb(map);
    viewModel.yhsbDataStream().listen((event) {
      if (event['code'] == '0') {
        _shangbaocontent.text = "";
        _wgNameid = "";
        _wgName = "";
        ToastUtils.showToast('上报成功');
        Navigator.pop(context);
      } else {
        ToastUtils.showToast(event['msg']);
      }
    }, onError: (e) {
      print(e);
    });
  }

  var _registerInfo; //登记信息
  var _determineInfo; //判定信息
  var _verifyInfo; //核查信息
  var _rectifyInfo; //整改信息
  var _acceptanceInfo; //验收信息

  ///获得数据
  _getData() async {
    viewModel.yhzlDetailModule(StringUtils.getStr(widget.zlMap['id']));
    viewModel.yhzlListDetailModuleStream().listen((result) {
      if (result['code'] == "0") {
        setState(() {
          _registerInfo = result['data']['registerInfo'];
          _determineInfo = result['data']['determineInfo'];
          _verifyInfo = result['data']['verifyInfo'];
          _rectifyInfo = result['data']['rectifyInfo'];
          _acceptanceInfo = result['data']['acceptanceInfo'];
        });
      } else {
        ToastUtils.showToast(result['msg']);
      }
    });
  }
}
